<?xml version="1.0" encoding="ascii"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
          "DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <title>esapi.reference.default_encryptor.DefaultEncryptor</title>
  <link rel="stylesheet" href="epydoc.css" type="text/css" />
  <script type="text/javascript" src="epydoc.js"></script>
</head>

<body bgcolor="white" text="black" link="blue" vlink="#204080"
      alink="#204080">
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
       bgcolor="#a0c0ff" cellspacing="0">
  <tr valign="middle">
  <!-- Home link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="esapi-module.html">Home</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Tree link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Index link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Help link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>

      <th class="navbar" width="100%"></th>
  </tr>
</table>
<table width="100%" cellpadding="0" cellspacing="0">
  <tr valign="top">
    <td width="100%">
      <span class="breadcrumbs">
        <a href="esapi-module.html">Package&nbsp;esapi</a> ::
        <a href="esapi.reference-module.html">Package&nbsp;reference</a> ::
        <a href="esapi.reference.default_encryptor-module.html">Module&nbsp;default_encryptor</a> ::
        Class&nbsp;DefaultEncryptor
      </span>
    </td>
    <td>
      <table cellpadding="0" cellspacing="0">
        <!-- hide/show private -->
        <tr><td align="right"><span class="options">[<a href="javascript:void(0);" class="privatelink"
    onclick="toggle_private();">hide&nbsp;private</a>]</span></td></tr>
        <tr><td align="right"><span class="options"
            >[<a href="frames.html" target="_top">frames</a
            >]&nbsp;|&nbsp;<a href="esapi.reference.default_encryptor.DefaultEncryptor-class.html"
            target="_top">no&nbsp;frames</a>]</span></td></tr>
      </table>
    </td>
  </tr>
</table>
<!-- ==================== CLASS DESCRIPTION ==================== -->
<h1 class="epydoc">Class DefaultEncryptor</h1><p class="nomargin-top"><span class="codelink"><a href="esapi.reference.default_encryptor-pysrc.html#DefaultEncryptor">source&nbsp;code</a></span></p>
<pre class="base-tree">
<a href="esapi.encryptor.Encryptor-class.html">encryptor.Encryptor</a> --+
                      |
                     <strong class="uidshort">DefaultEncryptor</strong>
</pre>

<hr />
<p>Default implementation of the Encryptor interface using Google's 
  Keyczar.</p>

<!-- ==================== INSTANCE METHODS ==================== -->
<a name="section-InstanceMethods"></a>
<table class="summary" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
  <td colspan="2" class="table-header">
    <table border="0" cellpadding="0" cellspacing="0" width="100%">
      <tr valign="top">
        <td align="left"><span class="table-header">Instance Methods</span></td>
        <td align="right" valign="top"
         ><span class="options">[<a href="#section-InstanceMethods"
         class="privatelink" onclick="toggle_private();"
         >hide private</a>]</span></td>
      </tr>
    </table>
  </td>
</tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="esapi.reference.default_encryptor.DefaultEncryptor-class.html#__init__" class="summary-sig-name">__init__</a>(<span class="summary-sig-arg">self</span>)</span></td>
          <td align="right" valign="top">
            <span class="codelink"><a href="esapi.reference.default_encryptor-pysrc.html#DefaultEncryptor.__init__">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="esapi.reference.default_encryptor.DefaultEncryptor-class.html#hash" class="summary-sig-name">hash</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">plaintext</span>,
        <span class="summary-sig-arg">salt</span>,
        <span class="summary-sig-arg">iterations</span>=<span class="summary-sig-default">None</span>)</span><br />
      Returns a string representation of the hash of the provided plaintext
      and salt.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="esapi.reference.default_encryptor-pysrc.html#DefaultEncryptor.hash">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="esapi.reference.default_encryptor.DefaultEncryptor-class.html#encrypt" class="summary-sig-name">encrypt</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">plaintext</span>)</span><br />
      Encrypts the provided plaintext and returns a ciphertext string.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="esapi.reference.default_encryptor-pysrc.html#DefaultEncryptor.encrypt">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="esapi.reference.default_encryptor.DefaultEncryptor-class.html#decrypt" class="summary-sig-name">decrypt</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">ciphertext</span>)</span><br />
      Decrypts the provided ciphertext string (encrypted with the encrypt 
      method) and returns a plaintext string.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="esapi.reference.default_encryptor-pysrc.html#DefaultEncryptor.decrypt">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="esapi.reference.default_encryptor.DefaultEncryptor-class.html#sign" class="summary-sig-name">sign</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">data</span>)</span><br />
      Create a digital signature for the provided data and returns it in a 
      string.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="esapi.reference.default_encryptor-pysrc.html#DefaultEncryptor.sign">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="esapi.reference.default_encryptor.DefaultEncryptor-class.html#verify_signature" class="summary-sig-name">verify_signature</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">signature</span>,
        <span class="summary-sig-arg">data</span>)</span><br />
      Verifies a digital signature (created with the sign method) and 
      return s the boolean result.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="esapi.reference.default_encryptor-pysrc.html#DefaultEncryptor.verify_signature">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="esapi.reference.default_encryptor.DefaultEncryptor-class.html#seal" class="summary-sig-name">seal</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">data</span>,
        <span class="summary-sig-arg">expiration</span>)</span><br />
      Creates a seal that binds a set of data and includes an expiration 
      timestamp.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="esapi.reference.default_encryptor-pysrc.html#DefaultEncryptor.seal">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="esapi.reference.default_encryptor.DefaultEncryptor-class.html#unseal" class="summary-sig-name">unseal</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">seal</span>)</span><br />
      Unseals data (created with the seal method) and raises an exception 
      describing any of the various problems that could exist with a seal, 
      such as an invalid seal format, expired timestamp, or decryption 
      error.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="esapi.reference.default_encryptor-pysrc.html#DefaultEncryptor.unseal">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="esapi.reference.default_encryptor.DefaultEncryptor-class.html#verify_seal" class="summary-sig-name">verify_seal</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">seal</span>)</span><br />
      Verifies a seal (created with the seal method) and returns True or 
      False, indicating whether or not the seal is valid.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="esapi.reference.default_encryptor-pysrc.html#DefaultEncryptor.verify_seal">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a name="gen_keys"></a><span class="summary-sig-name">gen_keys</span>(<span class="summary-sig-arg">self</span>)</span><br />
      Create new keys.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="esapi.reference.default_encryptor-pysrc.html#DefaultEncryptor.gen_keys">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
</table>
<!-- ==================== CLASS VARIABLES ==================== -->
<a name="section-ClassVariables"></a>
<table class="summary" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
  <td colspan="2" class="table-header">
    <table border="0" cellpadding="0" cellspacing="0" width="100%">
      <tr valign="top">
        <td align="left"><span class="table-header">Class Variables</span></td>
        <td align="right" valign="top"
         ><span class="options">[<a href="#section-ClassVariables"
         class="privatelink" onclick="toggle_private();"
         >hide private</a>]</span></td>
      </tr>
    </table>
  </td>
</tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <a name="VALID_ENCRYPTION_ALGOS"></a><span class="summary-name">VALID_ENCRYPTION_ALGOS</span> = <code title="'AES'"><code class="variable-quote">'</code><code class="variable-string">AES</code><code class="variable-quote">'</code></code>
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <a name="VALID_SIGNING_ALGOS"></a><span class="summary-name">VALID_SIGNING_ALGOS</span> = <code title="'DSA'"><code class="variable-quote">'</code><code class="variable-string">DSA</code><code class="variable-quote">'</code></code>
    </td>
  </tr>
</table>
<!-- ==================== METHOD DETAILS ==================== -->
<a name="section-MethodDetails"></a>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
  <td colspan="2" class="table-header">
    <table border="0" cellpadding="0" cellspacing="0" width="100%">
      <tr valign="top">
        <td align="left"><span class="table-header">Method Details</span></td>
        <td align="right" valign="top"
         ><span class="options">[<a href="#section-MethodDetails"
         class="privatelink" onclick="toggle_private();"
         >hide private</a>]</span></td>
      </tr>
    </table>
  </td>
</tr>
</table>
<a name="__init__"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">__init__</span>(<span class="sig-arg">self</span>)</span>
    <br /><em class="fname">(Constructor)</em>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="esapi.reference.default_encryptor-pysrc.html#DefaultEncryptor.__init__">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  
  <dl class="fields">
    <dt>Overrides:
        <a href="esapi.encryptor.Encryptor-class.html#__init__">encryptor.Encryptor.__init__</a>
    </dt>
  </dl>
</td></tr></table>
</div>
<a name="hash"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">hash</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">plaintext</span>,
        <span class="sig-arg">salt</span>,
        <span class="sig-arg">iterations</span>=<span class="sig-default">None</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="esapi.reference.default_encryptor-pysrc.html#DefaultEncryptor.hash">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <p>Returns a string representation of the hash of the provided plaintext 
  and salt. The salt helps to protect against a rainbow table attack by 
  mixing in some extra data with the plaintext. Some good choices for a 
  salt might be an account name or some other string that is known to the 
  application but not to an attacker. See <a 
  href="http://www.matasano.com/log/958/enough-with-the-rainbow-tables-what-you-need-to-know-about-secure-password-schemes/"
  target="_top">this article</a> for more information about hashing as it 
  pertains to password schemes.</p>
  <dl class="fields">
    <dt>Parameters:</dt>
    <dd><ul class="nomargin-top">
        <li><strong class="pname"><code>plaintext</code></strong> - the plaintext string to encrypt</li>
        <li><strong class="pname"><code>salt</code></strong> - the string salt to add to the plaintext string before hashing</li>
        <li><strong class="pname"><code>iterations</code></strong> - the number of times to iterate the hash. Defaults to 1.</li>
    </ul></dd>
    <dt>Returns:</dt>
        <dd>the encrypted hash of 'plaintext' stored as a String</dd>
    <dt>Raises:</dt>
    <dd><ul class="nomargin-top">
        <li><code><strong class='fraise'><a href="esapi.exceptions.EncryptionException-class.html">EncryptionException</a></strong></code> - if the specified hash algorithm could not be found or another 
        problem exists with the hashing of 'plaintext'</li>
    </ul></dd>
    <dt>Overrides:
        <a href="esapi.encryptor.Encryptor-class.html#hash">encryptor.Encryptor.hash</a>
        <dd><em class="note">(inherited documentation)</em></dd>
    </dt>
  </dl>
</td></tr></table>
</div>
<a name="encrypt"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">encrypt</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">plaintext</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="esapi.reference.default_encryptor-pysrc.html#DefaultEncryptor.encrypt">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <p>Encrypts the provided plaintext and returns a ciphertext string.</p>
  <dl class="fields">
    <dt>Parameters:</dt>
    <dd><ul class="nomargin-top">
        <li><strong class="pname"><code>plaintext</code></strong> - the plaintext string to encrypt</li>
    </ul></dd>
    <dt>Returns:</dt>
        <dd>the encrypted string representation of 'plaintext'</dd>
    <dt>Raises:</dt>
    <dd><ul class="nomargin-top">
        <li><code><strong class='fraise'><a href="esapi.exceptions.EncryptionException-class.html">EncryptionException</a></strong></code> - if the specified encryption algorithm could not be found or another
        problem exists with the encryption of 'plaintext'</li>
    </ul></dd>
    <dt>Overrides:
        <a href="esapi.encryptor.Encryptor-class.html#encrypt">encryptor.Encryptor.encrypt</a>
        <dd><em class="note">(inherited documentation)</em></dd>
    </dt>
  </dl>
</td></tr></table>
</div>
<a name="decrypt"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">decrypt</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">ciphertext</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="esapi.reference.default_encryptor-pysrc.html#DefaultEncryptor.decrypt">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <p>Decrypts the provided ciphertext string (encrypted with the encrypt 
  method) and returns a plaintext string.</p>
  <dl class="fields">
    <dt>Parameters:</dt>
    <dd><ul class="nomargin-top">
        <li><strong class="pname"><code>ciphertext</code></strong> - the ciphertext (encrypted plaintext)</li>
    </ul></dd>
    <dt>Returns:</dt>
        <dd>the decrypted ciphertext</dd>
    <dt>Raises:</dt>
    <dd><ul class="nomargin-top">
        <li><code><strong class='fraise'><a href="esapi.exceptions.EncryptionException-class.html">EncryptionException</a></strong></code> - if the specified encryption algorithm could not be found or another
        problem exists with the encryption of 'plaintext'</li>
    </ul></dd>
    <dt>Overrides:
        <a href="esapi.encryptor.Encryptor-class.html#decrypt">encryptor.Encryptor.decrypt</a>
        <dd><em class="note">(inherited documentation)</em></dd>
    </dt>
  </dl>
</td></tr></table>
</div>
<a name="sign"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">sign</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">data</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="esapi.reference.default_encryptor-pysrc.html#DefaultEncryptor.sign">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <p>Create a digital signature for the provided data and returns it in a 
  string.</p>
  <dl class="fields">
    <dt>Parameters:</dt>
    <dd><ul class="nomargin-top">
        <li><strong class="pname"><code>data</code></strong> - the data to sign</li>
    </ul></dd>
    <dt>Returns:</dt>
        <dd>the digital signature stored as a String</dd>
    <dt>Raises:</dt>
    <dd><ul class="nomargin-top">
        <li><code><strong class='fraise'><a href="esapi.exceptions.EncryptionException-class.html">EncryptionException</a></strong></code> - if the specified signature algorithm cannot be found</li>
    </ul></dd>
    <dt>Overrides:
        <a href="esapi.encryptor.Encryptor-class.html#sign">encryptor.Encryptor.sign</a>
        <dd><em class="note">(inherited documentation)</em></dd>
    </dt>
  </dl>
</td></tr></table>
</div>
<a name="verify_signature"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">verify_signature</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">signature</span>,
        <span class="sig-arg">data</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="esapi.reference.default_encryptor-pysrc.html#DefaultEncryptor.verify_signature">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <p>Verifies a digital signature (created with the sign method) and return
  s the boolean result.</p>
  <dl class="fields">
    <dt>Parameters:</dt>
    <dd><ul class="nomargin-top">
        <li><strong class="pname"><code>signature</code></strong> - the signature to verify against 'data'</li>
        <li><strong class="pname"><code>data</code></strong> - the data to verify against 'signature'</li>
    </ul></dd>
    <dt>Returns:</dt>
        <dd>true, if the signature is verified, false otherwise</dd>
    <dt>Overrides:
        <a href="esapi.encryptor.Encryptor-class.html#verify_signature">encryptor.Encryptor.verify_signature</a>
        <dd><em class="note">(inherited documentation)</em></dd>
    </dt>
  </dl>
</td></tr></table>
</div>
<a name="seal"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">seal</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">data</span>,
        <span class="sig-arg">expiration</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="esapi.reference.default_encryptor-pysrc.html#DefaultEncryptor.seal">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <p>Creates a seal that binds a set of data and includes an expiration 
  timestamp.</p>
  <dl class="fields">
    <dt>Parameters:</dt>
    <dd><ul class="nomargin-top">
        <li><strong class="pname"><code>data</code></strong> - the data to seal</li>
        <li><strong class="pname"><code>expiration</code></strong> - The relative or absolute time the seal should expire. If a 
          datetime object is passed in, it should be converted to seconds 
          since the epoch.
          <p>If a timedelta object is passed in, it should be added to 
          datetime.now() and converted to seconds since the epoch.</p>
          <p>If an int is passed in, it will be treated as the seconds 
          since the epoch.</p></li>
    </ul></dd>
    <dt>Returns:</dt>
        <dd>the seal</dd>
    <dt>Raises:</dt>
    <dd><ul class="nomargin-top">
        <li><code><strong class='fraise'><a href="esapi.exceptions.IntegrityException-class.html">IntegrityException</a></strong></code></li>
    </ul></dd>
    <dt>Overrides:
        <a href="esapi.encryptor.Encryptor-class.html#seal">encryptor.Encryptor.seal</a>
        <dd><em class="note">(inherited documentation)</em></dd>
    </dt>
  </dl>
</td></tr></table>
</div>
<a name="unseal"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">unseal</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">seal</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="esapi.reference.default_encryptor-pysrc.html#DefaultEncryptor.unseal">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <p>Unseals data (created with the seal method) and raises an exception 
  describing any of the various problems that could exist with a seal, such
  as an invalid seal format, expired timestamp, or decryption error.</p>
  <dl class="fields">
    <dt>Parameters:</dt>
    <dd><ul class="nomargin-top">
        <li><strong class="pname"><code>seal</code></strong> - the sealed data</li>
    </ul></dd>
    <dt>Returns:</dt>
        <dd>the original (unsealed) data</dd>
    <dt>Raises:</dt>
    <dd><ul class="nomargin-top">
        <li><code><strong class='fraise'><a href="esapi.exceptions.EncryptionException-class.html">EncryptionException</a></strong></code> - if the unsealed data cannot be retrieved for any reason</li>
    </ul></dd>
    <dt>Overrides:
        <a href="esapi.encryptor.Encryptor-class.html#unseal">encryptor.Encryptor.unseal</a>
        <dd><em class="note">(inherited documentation)</em></dd>
    </dt>
  </dl>
</td></tr></table>
</div>
<a name="verify_seal"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">verify_seal</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">seal</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="esapi.reference.default_encryptor-pysrc.html#DefaultEncryptor.verify_seal">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <p>Verifies a seal (created with the seal method) and returns True or 
  False, indicating whether or not the seal is valid.</p>
  <dl class="fields">
    <dt>Parameters:</dt>
    <dd><ul class="nomargin-top">
        <li><strong class="pname"><code>seal</code></strong> - the seal to verify</li>
    </ul></dd>
    <dt>Returns:</dt>
        <dd>true, if the seal is valid.  False otherwise</dd>
    <dt>Overrides:
        <a href="esapi.encryptor.Encryptor-class.html#verify_seal">encryptor.Encryptor.verify_seal</a>
        <dd><em class="note">(inherited documentation)</em></dd>
    </dt>
  </dl>
</td></tr></table>
</div>
<br />
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
       bgcolor="#a0c0ff" cellspacing="0">
  <tr valign="middle">
  <!-- Home link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="esapi-module.html">Home</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Tree link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Index link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Help link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>

      <th class="navbar" width="100%"></th>
  </tr>
</table>
<table border="0" cellpadding="0" cellspacing="0" width="100%%">
  <tr>
    <td align="left" class="footer">
    Generated by Epydoc 3.0.1 on Sun Nov  8 16:04:21 2009
    </td>
    <td align="right" class="footer">
      <a target="mainFrame" href="http://epydoc.sourceforge.net"
        >http://epydoc.sourceforge.net</a>
    </td>
  </tr>
</table>

<script type="text/javascript">
  <!--
  // Private objects are initially displayed (because if
  // javascript is turned off then we want them to be
  // visible); but by default, we want to hide them.  So hide
  // them unless we have a cookie that says to show them.
  checkCookie();
  // -->
</script>
</body>
</html>
